home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HPAVC
/
HPAVC CD-ROM.iso
/
FNTPAK32.ZIP
/
PASCAL.EXE
/
DEMO_LIN.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1995-08-16
|
4KB
|
111 lines
{*******************************************************************
Demo_Lin.Pas Copyright 1994, Rob W. Smetana
Font Pak demo program which shows how to:
1. Use SetMaxLines (...) to switch to 14 - 100 lines on
the screen -- in TEXT mode!
2. Load a Font Pak font (from 4 to 24 points) to finish
the process.
NOTICE: We MUST add 100 to Block number to make this work.
Requires:
a. A callable Font Pak font (e.g., Tiny04.F06)
b. Procedures in Video.Obj (SetmaxLines, WriteChar, etc.)
********************************************************************}
Uses Crt, { for TextMode (...), etc. }
Font_Pak; { for declarations & to link OBJs }
{$F+} (*BE SURE to make FAR calls to our procedures!!!! *)
Procedure TINY04(Block: Integer); External;
{$L tiny04.Obj}
{$F-}
{ ********************************************************************** }
Var
MonType, CharHite, NumLines, Col : Integer;
s: string;
{****************************************************}
procedure ShowLines (NumLines:Integer);
{****************************************************}
var
s,l:string;
Row, Char, AsciiCode, LenString, Colr:Integer;
Begin
s := ' This is line #: Press <enter>...'; { fill the blanks below }
LenString := ord(s[0]);
Colr := 79; { 79 = white on red }
For Row := 3 to NumLines Do
Begin
Str(Row,l);
For Char := 1 to ord(l[0]) do { plug in current line # }
s[Char + 17] := l[char];
For Char := 1 to LenString Do
Begin
AsciiCode := ord(s[Char]); { WriteChar needs an INT}
WriteChar (Row, 22+Char, AsciiCode, Colr);
End;
End;
ReadLn;
End;
{****************************************************}
Begin
{****************************************************}
TextAttr := 27; ClrScr;
fpinitialize; ClrScr; { for shareware versions only }
MonType := GetMonitor;
if (MonType < 4) then
Begin
WriteLn ('Sorry. An EGA or VGA monitor is required.');
Halt;
End;
{ NOTE:
On VGA monitors, here's how you can get 28 lines using the 8x14.
If you have an EGA, the default 8x14 yields the default 25 lines.
}
TextMode(co80 + font8x8); { ALWAYS change screen modes! }
CharHite := 14; { use the default 8x14 }
NumLines := SetMaxLines (CharHite);
rsLoadDefault(CharHite, 0+100); { load it into block 0 -- the default }
{ BE SURE to add 100 to block # }
TextAttr := 112; GotoXY(12,1);
Write (' Using the default 8x14, we can get ', NumLines, ' lines on the screen! ');
ShowLines (NumLines);
TextMode(co80 + font8x8); { get max # of lines }
CharHite := 6; { tiny04 is a 4-point font in 6x8 grid }
NumLines := SetMaxLines (CharHite);
Tiny04 (0+100); { re-map block 0 -- the default font }
{ BE SURE to add 100 to block # }
TextAttr := 112; GotoXY(14,1);
Write (' Using font Tiny04, we can get ', NumLines, ' lines on the screen! ');
ShowLines (NumLines);
TextMode(co80); { restore some normalcy }
End.